package com.example.dakotanews.dto;

import com.example.dakotanews.entity.BlogSection;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description 用户属性信息中的关注论坛版块的信息
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FollowSectionDTO {

    private Integer id;
    private String name;
    private String description;
    private int blogCount;
    private int followers;
    private String icon;
    private String bgColor;
    private String iconColor;

    // blogCount需要单独统计赋值
    public FollowSectionDTO(BlogSection blogSection) {
        this.id = blogSection.getId();
        this.name = blogSection.getSectionName();
        this.description = blogSection.getIntroduction();
        this.followers = blogSection.getFollowerNum();
        this.icon = blogSection.getIconClass();
        this.bgColor = blogSection.getIconBgColor();
        this.iconColor = blogSection.getIconColor();
    }
}
